import java.util.*;

class Person {
    private String name;
    private int age;
    public Person() {

    }
    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }
   /* public Person(String name) {
        this.name = name;
    }*/
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
   /* public int getAge() {
        return age;
    }
    public void setAge(int age) {
        this.age = age;
    }*/
    /*private void eat() {
        System.out.println("吃饭！");
    }*/
    public void show() {
        System.out.println(name+" "+age);
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}

public class Test2 {
        public static void main(String[] args) {
            Person person = new Person("zhangsan",10);
            System.out.println(person);

            //person.show();
        }
        public static void main1(String[] args) {
            Person person = new Person("zhangsan",10);
            person.setName("lisi");
            System.out.println(person.getName());
            person.show();

        /*person.name = "zhangsan";
        person.eat();*/
        }
}

